<extend name="Public/publicHTML" />
<block name="nav"></block>


<block name="content">
<link rel="stylesheet" href="__COMMON__/bootstrap/css/bootstrap.min.css" />
<link rel="stylesheet"
	href="__COMMON__/bootstrap/css/font-awesome.min.css" />
<section class="content">
	<div class="container-fluid">
		<div class="panel panel-default">
			<div class="panel-heading">
				<h3 class="panel-title">
					<i class="fa fa-list"></i> 品牌列表
				</h3>
			</div>
			<div class="panel-body">
				<div class="navbar navbar-default">
					<form id="search-form2" class="navbar-form form-inline"
						method="post" action="{:U('index')}">
						<div class="form-group">
							<label for="input-order-id" class="control-label">名称:</label>
							<div class="input-group">
								<input type="text" class="form-control" id="input-order-id"
									placeholder="搜索词" value="{$_POST[$model::$brandName_d]}" name="{$model::$brandName_d}">
							</div>
						</div>
						<div class="form-group">
							<button class="btn btn-primary" id="button-filter search-order"
								type="submit">
								<i class="fa fa-search"></i> 筛选
							</button>
						</div>
						<button type="button" class="btn btn-primary pull-right"
							onclick="Tool.alertEdit('{:U('addBrand')}','添加品牌', 900, 600)">
							<i class="fa fa-plus"></i> 添加品牌
						</button>
					</form>
				</div>

				<div id="ajax_return">

					<div class="table-responsive">
						<table class="table table-bordered table-hover">
							<thead>
								<tr>
									<th class="sorting text-left">ID</th>
									<th class="sorting text-left">品牌名称</th>
									<th class="sorting text-left">Logo</th>
									<th class="sorting text-left">商品分类</th>
									<th valign="middle">是否推荐</th>
									<th class="sorting text-left">更新日期</th>
									<th class="sorting text-left">操作</th>
								</tr>
							</thead>
							<tbody>
								<if condition="!empty($brand['data'])"> <foreach
									name="brand['data']" item="list">
								<tr>
									<td class="text-right">{$list[$model::$id_d]}</td>
									<td class="text-left">{$list[$model::$brandName_d]}</td>
									<td class="text-left"><a
										href="{$list[$model::$brandLogo_d]}?a={:time()}"
										target="_blank"><img
											onmouseover="$(this).attr('width','80').attr('height','45');"
											onmouseout="$(this).attr('width','40').attr('height','30');"
											width="40" height="30" src="{$list[$model::$brandLogo_d]}" /></a></td>
									<td class="text-left">{$list[$classModel::$className_d]}</td>

                                    <td>
                                        <img title="{$title['recommend']}" data-status="{$list[$model::$recommend_d]}" width="20" height="20" src="{$image_type[$list[$model::$recommend_d]]}"
                                             onclick="Brand.recommend({$list[$model::$id_d]},this,'{:U('isRecommend')}')"/>
                                    </td>

									<td class="text-left">{$list[$model::$updateTime_d]|date='Y-m-d
										H:i:s', ###}</td>
									<td class="text-left"><a
										onclick="Tool.alertEdit('{:U('editBrandHtml',array($model::$id_d=>$list[$model::$id_d]))}','编辑品牌', 900, 600)"
										href="javascript:;" data-toggle="tooltip" title=""
										class="btn btn-primary" data-original-title="编辑"><i
											class="fa fa-pencil"></i></a> <a href="javascript:void(0);"
										onclick="Brand.delBrand({$list[$model::$id_d]}, '{:U('delBrand')}')"
										id="button-delete6" data-toggle="tooltip" title=""
										class="btn btn-danger" data-original-title="删除"><i
											class="fa fa-trash-o"></i></a></td>
								</tr>
								</foreach> </if>
							</tbody>
						</table>
					</div>

					<div class="page">
						<div class="col-sm-6 text-left"></div>
						<div class="col-sm-6 text-right">{$brand.page}</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</section>
<script type="text/javascript" src="__COMMON__/js/alert.js"></script>
<script type="text/javascript" src="__JS__/brand/brand.js"></script>
<script>
	var imgUrl = {$json_image_type};
</script>
</block>